import React, { useState } from 'react';
import { Select } from 'antd';
import { options, chartsMap } from './config';
import styles from './index.less';

const { Option } = Select;

export default function Index() {
  const [chart, setChart] = useState('V1.50.0Chart');
  return (
    <div className={styles['charts-container']}>
      选择图表：
      <Select
        value={chart}
        style={{
          width: 200,
          marginBottom: 20,
        }}
        onChange={v => setChart(v)}
      >
        {options.map(opt => (
          <Option key={opt.key} value={opt.val}>
            {opt.key}
          </Option>
        ))}
      </Select>
      {chartsMap[chart]}
    </div>
  );
}
